-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mx 16271 indexing incoming tokens #325
base: feat/sovereign
Are you sure you want to change the base?
Conversation
# Conflicts: # integrationtests/valuesIndex_test.go
scripts/script.sh
Outdated
@@ -1,4 +1,5 @@ | |||
IMAGE_NAME=elastic-container | |||
IMAGE_NAME_2=elastic-container-2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps another name?
@@ -119,15 +83,30 @@ func (sit *sovereignIndexTokensHandler) getTokensFromScrs(elasticClient elasticp | |||
return newTokens, nil | |||
} | |||
|
|||
func getTokenCollection(hasPrefix bool, tokenIdentifier string) (bool, string) { | |||
func (sit *sovereignIndexTokensHandler) extractSovereignTokens(tokens []string) []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (sit *sovereignIndexTokensHandler) extractSovereignTokens(tokens []string) []string { | |
func (sit *sovereignIndexTokensHandler) extractNewSovereignTokens(tokens []string) []string { |
@@ -23,3 +23,9 @@ | |||
username = "" | |||
password = "" | |||
bulk-request-max-size-in-bytes = 4194304 # 4MB | |||
|
|||
[config.main-chain-elastic-cluster] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can add a comment here to describe for what is used this section of config
@@ -75,6 +79,9 @@ func (mrtc *managedRunTypeComponents) CheckSubcomponents() error { | |||
if check.IfNil(mrtc.rewardTxData) { | |||
return transactions.ErrNilRewardTxDataHandler | |||
} | |||
if check.IfNil(mrtc.indexTokensHandler) { | |||
return transactions.ErrNilIndexTokensHandler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you should move transactions.ErrNilIndexTokensHandler
in another package, because it is not relayed with the transactions package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to dataIndexer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you should rename the file in disalbedIndexTokensHandler or similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed
return "" | ||
} | ||
|
||
func (sit *sovereignIndexTokensHandler) indexNewTokens(responseTokensInfo []data.ResponseTokenInfoDB, buffSlice *data.BufferSlice) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can rename this function in serializeNewTokens
@@ -33,6 +31,8 @@ type ArgsIndexerFactory struct { | |||
UseKibana bool | |||
ImportDB bool | |||
Sovereign bool | |||
ESDTPrefix string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from where do you read the value of this parameter ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added parameter in config.toml
@@ -13,6 +13,12 @@ import ( | |||
"github.com/multiversx/mx-chain-es-indexer-go/process/elasticproc/tokeninfo" | |||
) | |||
|
|||
// MainChainDatabaseClientHandler defines the actions that sovereign database client handler should do | |||
type MainChainDatabaseClientHandler interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this have an IsInterfaceNil
func as well?
|
||
// NewMainChainElasticClient creates a new sovereign elastic client | ||
func NewMainChainElasticClient(cfg elasticsearch.Config, indexingEnabled bool) (*mainChainElasticClient, error) { | ||
esClient, err := NewElasticClient(cfg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This again should've been passed as an interface here, not created within this constructor
file: ./Dockerfile | ||
push: true | ||
file: ./Dockerfile-sovereign | ||
push: ${{ github.event_name == 'release' && github.event.action == 'published' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we will only use github actions for sovereign and remove the regular ones on this branch?
Proposed changes
IndexTokensHandler
Testing procedure